package com.ce.pms.occupation.dao.impl;

import java.util.List;

import com.ce.pms.base.dao.impl.PmsBaseDaoImpl;
import com.ce.pms.occupation.dao.IThingHandoverDao;
import com.ce.pms.occupation.model.ThingHandoverDO;

/**
 * 物品移交Dao
 * @author 王浩羽
 *
 */
public class ThingHandoverDaoImpl extends PmsBaseDaoImpl<ThingHandoverDO> implements
IThingHandoverDao
{

	public ThingHandoverDO getHandoverByIndentityId(Long identityId)
	{
		StringBuilder hqlBuilder = new StringBuilder();
		hqlBuilder.append("SELECT ").append(" OBJ FROM ").append(ThingHandoverDO.class.getSimpleName())
		.append(" AS OBJ WHERE ").append("OBJ.identityValidate.keyword = ?");
		List<ThingHandoverDO> list = this.createQuery(hqlBuilder.toString(), identityId).list();
		if(list!=null && !list.isEmpty())
		{
			return list.get(0);
		}
		return null;
	}

}
